<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout">
<body>
<!-- div 替换 -->
<head th:replace="~{fragment/header :: header}"></head>

<!-- container -->
<div class="container blog-content-container">
	<div class="row">
		<h2 th:text="${userModel.title}">Welcome to ndood.com</h2>
	</div>
	
	<div class="row">
		<p>
			<a class="btn btn-default" href="/users/form.html" th:href="@{/users/form}">创建用户</a>
		</p>
	</div>

	<div class="row">
		<table class="table table-striped">
			<thead>
				<tr>
					<td>ID</td>
					<td>Email</td>
					<td>Name</td>
				</tr>
			</thead>
			<tbody>
				<tr th:if="${userModel.userList.size()} eq 0">
					<td colspan="3">没有用户信息！</td>
				</tr>
				<!-- 循环 -->
				<tr th:each="user : ${userModel.userList}">
					<!-- 文本 -->
					<td th:text="${user.id}"></td>
					<td th:text="${user.email}"></td>
					<!-- 超链接的写法2 -->
					<td><a th:href="@{'/users/'+${user.id}}" th:text="${user.name}"></a></td>
				</tr>
			</tbody>
		</table>
	</div>
</div><!-- /.container -->

<div th:replace="~{fragment/footer :: footer}">...</div>
</body>
</html>